﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace JiZiYan.Controllers{

    /// <summary>
    /// 验证是否具有访问该页面权利
    /// </summary>
    public class seturlAttribute : FilterAttribute, IActionFilter
    {
        public void OnActionExecuted(ActionExecutedContext filterContext)
        {            
            string username = filterContext.HttpContext.User.Identity.Name;            
        }

        public void OnActionExecuting(ActionExecutingContext filterContext)
        {
            string loginName = filterContext.HttpContext.User.Identity.Name;
            string indexName = filterContext.RouteData.Values["Action"].ToString();
            string urlName = filterContext.RouteData.Values["Controller"].ToString();            
        }
    }
    /// <summary>
    /// 过滤器控制器
    /// </summary>
    public class FilterAttributeController : Controller
    {
        // GET: FilterAttribute
        public ActionResult Index()
        {
            return View();
        }
    }
}